<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>

    </h:head>
    <h:body>
        <ui:composition>  

            <c:if test="${detailmobile.getMadienthoai()!=-1}" >
                <table border="1" width="600">

                    <tr align="center">
                        <td align="center">
                            Thông tin chi tiết điện thoại
                        </td>
                    </tr>

                    <tr align="center" >
                        <td align="center" colspan="0">
                            <h:graphicImage library="images" name="${detailmobile.DT.hinhanh.replace('ô', 'o')}"></h:graphicImage>
                        </td>
                        <td>
                            <div class="fb-like" data-href="https://www.google.com.vn/" data-send="false" data-layout="box_count" data-width="450" data-show-faces="true" data-font="verdana" data-colorscheme="dark">

                            </div>
                            <br/>
                            <br/>
                            <br/>
                            <br/>
                            <br/>
                            <br/>
                            <c:set var="madienthoai" value="${detailmobile.getMadienthoai()}"/>
                            <h:commandLink action="#{GioHang.setAddHangTrongGio(madienthoai)}">
                                <h:graphicImage library="images"  name="themvaogio.jpg"  />
                            </h:commandLink>
                        </td>





                    </tr>


                    <tr>
                        <td align="left">
                            <h:outputText value="Giá:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.giaban}" >
                                <f:convertNumber type="currency"  currencyCode="VND" groupingUsed="true"  maxFractionDigits="0"/> 
                            </h:outputText>
                        </td>
                    </tr>


                    <tr>
                        <td align="left">
                            <h:outputText value="Hỗ trợ âm sắc:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.thongtinsanpham.amthanh}" />
                        </td>
                    </tr>

                    <tr>
                        <td align="left">
                            <h:outputText value="Bộ nhớ trong:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.thongtinsanpham.bonho}" />
                        </td>
                    </tr>

                    <tr>
                        <td align="left">
                            <h:outputText value="Camera:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.thongtinsanpham.chupanh}" />
                        </td>
                    </tr>

                    <tr>
                        <td align="left">
                            <h:outputText value="Hiển thị:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.thongtinsanpham.hienthi}" />
                        </td>
                    </tr>

                    <tr>
                        <td align="left">
                            <h:outputText value="Kích thước điện thoại:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.thongtinsanpham.kichthuoc}" />
                        </td>
                    </tr>

                    <tr>
                        <td align="left">
                            <h:outputText value="Dung lượng pin:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.thongtinsanpham.pin}" />
                        </td>
                    </tr>

                    <tr>
                        <td align="left">
                            <h:outputText value="Tốc độ truyền dữ liệu:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.thongtinsanpham.tocdotruyendulieu}" />
                        </td>
                    </tr>


                    <tr>
                        <td align="left">
                            <h:outputText value="Số người đã xem:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.soluongxem.toString()}" />
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            <h:outputText value="Số Lượng Bán:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.soluongban.toString()}" />
                        </td>
                    </tr>
                      <tr>
                        <td align="left">
                            <h:outputText value="Xuất Xứ:" style="font-style: italic;color: purple"/>
                        </td>
                        <td align="left">
                            <h:outputText value="${detailmobile.DT.xuatxu}" />
                        </td>
                    </tr>

                </table>
                <br/>




                <h:graphicImage width="750" height="10" style="background-color: black " />
                Các điện thoại cùng loại
                <h:graphicImage width="750" height="10" style="background-color: black " />
                <table width="746" border="1">
                    <c:forEach var ="ii" begin="0" end="3">
                        <tr>
                            <c:forEach var ="i" begin="0" end="3">
                                <c:set var="tt" value="${(ii*4+i)}"/>
                                <c:if test="${detailmobile.danhSach5DienThoai.size()>tt}">
                                    <c:set var="dt" value="${detailmobile.danhSach5DienThoai.get(tt)}"/>    
                                    <td width="186" height="220" align="center" >    

                                        <c:set var="madienthoai" value="${dt.madienthoai}"/>

                                        <h:commandLink action="#{detailmobile.setThongtin1sanpham(madienthoai)}">
                                            <h:graphicImage library="images"  name="${dt.hinhanh.replace('ô', 'o')}"  height="186" width="186"/>
                                        </h:commandLink>



                                        <br/>
                                        <br/>

                                        <c:set var="tendt" value="${dt.tendienthoai}"/>
                                        <c:set var="madt" value="${dt.madienthoai}"/>
                                        <h:outputText value="${tendt}"/>
                                        <c:set var="giadt" value="${dt.giaban}"/>
                                        <br/>
                                        <h:outputText value="${dt.giaban}">
                                            <f:convertNumber type="currency"  currencyCode="VND" groupingUsed="true"  maxFractionDigits="0"/> 
                                        </h:outputText>

                                        <h:commandButton action="#{GioHang.setAddHangTrongGio(madt)}" value="Thêm Vào Giỏ Hàng"/>


                                    </td>
                                </c:if>
                            </c:forEach>
                        </tr>  
                    </c:forEach>
                </table>













                <br>
                </br>
                <h:graphicImage width="750" height="10" style="background-color: black " />




                <c:if test="${detailmobile.getDanhsachbinhluan().size() != 0}"  >
                    <h:dataTable  value="#{detailmobile.danhsachbinhluan}" var="danhsach" styleClass="order-table" headerClass="order-table-header" rowClasses="order-table-odd-row,order-table-even-row">
                        <h:column>
                            <f:facet name="header">Email</f:facet>
                            #{danhsach.taikhoan.tendangnhap}
                        </h:column>

                        <h:column>
                            <f:facet name="header">Nội dung bình luận</f:facet>
                            #{danhsach.binhluan}
                        </h:column> 
                    </h:dataTable>
                </c:if>

                <c:if test="${detailmobile.getDanhsachbinhluan().size() == 0}"  >
                    Chưa có bình luận
                </c:if>

                <h:graphicImage width="750" height="10" style="background-color: black " />
                <table>
                    <tr>
                        <br>
                        </br>

                    </tr>

                    <tr>

                        <h:outputLabel for="binhluan" id="mycomment">Viết bình luận:</h:outputLabel>
                    </tr>
                    <tr>
                        <h:inputTextarea  value="#{detailmobile.loibinhluan}" style="width: 650px;height: 80px" label="Write your comment here...">

                        </h:inputTextarea>
                    </tr>

                </table>

                <h:commandButton value="Post Comment" action="#{detailmobile.setAddbinhluan()}"></h:commandButton>

            </c:if>


        </ui:composition>
    </h:body>
</html>
